#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int i, char* args[]) {

	int buffer_size = 512;
	char* buffer = (char*) malloc(sizeof(char) * buffer_size);
	char* res = (char*) malloc(sizeof(char) * buffer_size);
	FILE* fp = popen("df", "r");
	memset(buffer, 0, buffer_size);
	memset(res, 0, buffer_size);
	char* s = NULL;
	while ((s = fgets(buffer, buffer_size, fp)) != NULL) {
		strncat(res, buffer, strlen(buffer));
	}
	pclose(fp);
	printf("%s\n",res);

	return 1;
}
